import time


def stream_data():
    print("调用了 stream_data 函数，开始生成数据流")
    data = [i for i in range(10)]
    for i in data:
        time.sleep(1)
        yield i


data = stream_data()

for i in data:
    print(i)
